import fetch from 'utils/fetch';

//查询业务员
export function salesmanList(data) {
  return fetch({
    url: 'api/admin/salesman/screenSelectSalesman',
    method: 'post',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
    data
  });
}

//新增业务员
export function salesmanAdd(data) {
  return fetch({
    url: 'api/admin/salesman/insertSelective',
    method: 'post',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
    data
  });
}

//验证业务员编号
export function validateSalesmanNum(salesmanNumber,BD_id) {
  return fetch({
    url: 'api/admin/salesman/getSalesmanNumberFindSalesman/' + salesmanNumber + '/' + BD_id + '/s',
    method: 'get',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
  });
}

//修改业务员信息
export function modifySalesman(data) {
  return fetch({
    url: 'api/admin/salesman/updateSalesman',
    method: 'post',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
    data
  });
}

//验证新增澳洲业务员邮箱
export function validateEmailAdd(email) {
  return fetch({
    url: 'api/admin/salesman/verificationSalesmanEmail/' + email +  '/s',
    method: 'get',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
  });
}

//验证修改澳洲业务员邮箱
export function validateEmailModify(email,salesmanId) {
  return fetch({
    url: 'api/admin/salesman/verificationSalesmanEmail/' + email + '/' + salesmanId + '/s',
    method: 'get',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
  });
}


//验证新增香港业务员手机号
export function validatePhoneAdd(phone) {
  return fetch({
    url: 'api/admin/salesman/verificationSalesmanPhone/' + phone +  '/s',
    method: 'get',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
  });
}

//验证修改香港业务员手机号
export function validatePhoneModify(phone,salesmanId) {
  return fetch({
    url: 'api/admin/salesman/verificationSalesmanPhone/' + phone + '/' + salesmanId +   '/s',
    method: 'get',
    headers: {'Content-type': 'application/json;charset=UTF-8'},
  });
}